﻿@model IEnumerable<HotelManageSystem.Models.DepartmentModel> 
<link href= "@Url.Content("~/Content/TelerikGrid.css")"rel="stylesheet" type="text/css" />
<style>
    textarea
    {
        max-width: 220px;
        max-height: 50px;
        min-width: 220px;
        min-height: 50px;
        resize: none;
    }
</style>
@(
 Html.Telerik().Grid(Model)
         .Name("DepartmentsGrid")
         .DataKeys(keys => keys.Add(r => r.ID))
         .ToolBar(command => command.Insert())
         .DataBinding(dataBinding => dataBinding.Ajax()
                .OperationMode(GridOperationMode.Client)
                .Select("TelerikAjax", "Department")
                .Insert("Insert", "Department")
                .Update("Update", "Department")
                .Delete("Delete", "Department")
            )
         .Sortable(sorting => sorting
                .SortMode(GridSortMode.SingleColumn))
         .Pageable(paging => paging
                .Style(GridPagerStyles.NextPreviousAndNumeric)
                .Position(GridPagerPosition.Bottom)
                .PageSize(3))
         .Columns(columns =>
                      {
                          columns.Bound(r => r.ID).Width(100);
                          columns.Bound(r => r.Name).Width(100);
                          columns.Bound(p => p.Remark)
                                           .Template(pi => @Html.Raw("<textarea id='roleReamrk' name='roleRemark' rows='3' cols='50' disabled='disabled'>" + pi.Remark + "</textarea>"))
                                           .ClientTemplate("<textarea id='roleReamrk' name='roleRemark' rows='3' cols='50' disabled='disabled'><#= Remark #></textarea>")
                                           .Width(210);
                          columns.Command(commands =>
                          {
                              commands.Edit();
                              commands.Delete();
                          }).Width(100);
                      })
         .Editable(editing => editing.Mode(GridEditMode.PopUp))
         .Selectable()
         .Scrollable()
)
